<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<link rel="stylesheet" href="/layui/css/layui.css">
<head>
    <script th:src="@{/assets/js/jquery.min.js}"></script>
    <script th:src="@{/assets/js/layer.js}"></script>
</head>

<div th:replace="client/header::header(null,null)"></div>
<body>
<div class="am-g am-g-fixed blog-fixed index-page" style="background-color: whitesmoke">
    <div class="am-u-md-8 am-u-sm-12">
        <article class="main-content post-page">
            <div class="post-header">
                <h1 class="post-title" itemprop="name headline" th:text="${session.course.getCourse_name()}"></h1>
                <div class="post-data">
                    <time th:datetime="${session.course.getCreated()}" itemprop="datePublished"
                          th:text="'发布于 '+ ${commons.dateFormat(session.course.getCreated())}"></time>
                </div>
            </div>
            <br/>
            <div id="post-content" class="post-content content" th:utext="${session.course.getCourse_describe()}"></div>

                <a th:href="@{/user/}" class="btn btn-primary waves-effect waves-light"
                   style="margin-left: 700px;margin-top: 50px">
                    返回首页
                </a>
        </article>
    </div>
    <!-- 博主信息描述 -->
    <div class="am-u-md-4 am-u-sm-12 blog-sidebar">
        <div class="blog-sidebar-widget blog-bor">

            <div class="am-panel-group">
                <section class="am-panel am-panel-default" id="rt_bulletin">
                    <div class="am-panel-hd panel-head">班级公告</div>
                    <div class="am-panel-bd">
                        <div style="margin-top: 20px">
                            <p>昵称：<strong th:text="${session.user.getUsername()}"></strong></p>
                            <p>发表文章数：41</p>
                            <p>交流年龄：4年</p>
                        </div>
                    </div>
                </section>
                <section class="am-panel am-panel-default" id="rt_homeworks">
                    <div class="am-panel-hd"><span class="panel-head"><a
                            onclick="window.location.href = '/campus/dglgxy/CyberspaceSecurityAcademy/homework'"
                            href="javascript:;">最新作业</a></span></div>
                    <div class="am-panel-bd"><p style="margin: 12px 0;">暂无最新作业</p></div>
                </section>
                <section class="am-panel am-panel-default" id="rt_votes">
                    <div class="am-panel-hd"><span class="panel-head"><a
                            onclick="window.location.href = '/campus/dglgxy/CyberspaceSecurityAcademy/vote'"
                            href="javascript:;">最新投票</a></span></div>
                    <div class="am-panel-bd"><p style="margin: 12px 0;">暂无最新投票</p></div>
                </section>
                <section class="am-panel am-panel-default" id="rt_members">
                    <div class="am-panel-hd panel-head">班级成员()</div>
                    <div class="am-panel-bd">

                        <div class="member-group-divider"><span class="member-group-dividerText">学生</span></div>
                        <ul class="am-avg-sm-4 member-group">
                            <th:block th:each="course_people:${course_peopleList.list}">
                                <li class="am-text-center" style="position: relative;">
                                    <a style="font-size: 15px;"
                                       th:text="${course_peopleStat.index+1}+'、'+${course_people.name}">
                                    </a>
                                </li>
                            </th:block>
                        </ul>
                    </div>
                    <!-- 进行评论分页 -->
                    <div class="lists-navigator clearfix">
                        <ol class="page-navigator">
                            <!-- 判断并展示上一页 -->
                            <th:block th:if="${course_peopleList.hasPreviousPage}">
                                <td class="prev"><a
                                        th:href="'?cpage='+${course_peopleList.prePage}+'#course_peopleList'">上一页</a></td>
                            </th:block>
                            <!-- 判断并展示中间页 -->
                            <th:block th:each="navIndex : ${course_peopleList.navigatepageNums}">
                                <th:block th:if="${course_peopleList.pages} <= 5">
                                    <td th:class="${course_peopleList.pageNum}==${navIndex}?'current':''">
                                        <a th:href="'?cpage='+${navIndex}+'#course_peopleList'" th:text="${navIndex}"></a>
                                    </td>
                                </th:block>
                                <th:block th:if="${course_peopleList.pages} > 5">
                                    <td th:if="${course_peopleList.pageNum <=3 &&  navIndex <= 5}"
                                        th:class="${course_peopleList.pageNum}==${navIndex}?'current':''">
                                        <a th:href="'?cpage='+${navIndex}+'#course_peopleList'" th:text="${navIndex}"></a>
                                    </td>
                                    <td th:if="${course_peopleList.pageNum >= course_peopleList.pages-2 &&  navIndex > course_peopleList.pages-5}"
                                        th:class="${course_peopleList.pageNum}==${navIndex}?'current':''">
                                        <a th:href="'?cpage='+${navIndex}+'#course_peopleList'" th:text="${navIndex}"></a>
                                    </td>
                                    <td th:if="${course_peopleList.pageNum >=4 && course_peopleList.pageNum <= course_peopleList.pages-3 &&  navIndex >= course_peopleList.pageNum-2 && navIndex <= course_peopleList.pageNum+2}"
                                        th:class="${course_peopleList.pageNum}==${navIndex}?'current':''">
                                        <a th:href="'?cpage='+${navIndex}+'#course_peopleList'" th:text="${navIndex}"></a>
                                    </td>
                                </th:block>
                            </th:block>
                            <!-- 判断并展示下一页 -->
                            <th:block th:if="${course_peopleList.hasNextPage}">
                                <td class="next"><a
                                        th:href="'?cpage='+${course_peopleList.nextPage}+'#course_peopleList'">下一页</a></td>
                            </th:block>
                        </ol>
                    </div>
                </section>
                <section class="am-panel am-panel-default" id="rt_bloglinks" style="display: none;">
                    <div class="am-panel-hd panel-head">推荐博客</div>
                    <div class="am-panel-bd"></div>
                </section>
                <section class="am-panel am-panel-default" id="rt_blogposts">
                    <div class="am-panel-hd panel-head">热门博文</div>
                    <div class="am-panel-bd">
                        <ul class="panel-catalog">
                            <li class="of-hidden"><span class="am-badge am-badge-warning am-round">1</span><a
                                    title="posted lynnzixing 阅读(77)"
                                    href="https://www.cnblogs.com/lynnzixing/p/13786254.html" target="_blank"> Adobe
                                Acrobat XI与Office2016不兼容导致pdfmaker无法使用</a></li>
                            <li class="of-hidden"><span class="am-badge am-badge-warning am-round">2</span><a
                                    title="posted lynnzixing 阅读(69)"
                                    href="https://www.cnblogs.com/lynnzixing/p/13787758.html" target="_blank">
                                正则表达式是个好东西，希望人人可以掌握</a></li>
                        </ul>
                    </div>
                </section>
                <section class="am-panel am-panel-default" id="rt_labels" style="display: none;"></section>
            </div>
        </div>
    </div>
    <!--<length><h3 style="color: #2e6da4;margin-left: 380px">最新评论</h3></length>
    <hr style="width:800px;height: 3px;background-color:#7dffc5;align-content: center;margin-left: 380px"/>
    <div th:replace="client/comments::comments"></div>-->
</div>
<div th:replace="client/footer::footer"></div>
<!-- 使用layer.js实现图片缩放功能 -->
<script type="text/JavaScript">
    $('.post-content img').on('click', function () {
        var imgurl = $(this).attr('src');
        var w = this.width * 2;
        var h = this.height * 2 + 50;
        layer.open({
            type: 1,
            title: false, //不显示标题栏
            area: [w + "px", h + "px"],
            shadeClose: true, //点击遮罩关闭
            content: '\<\div style="padding:20px;">' +
            '\<\img style="width:' + (w - 50) + 'px;" src=' + imgurl + '\>\<\/div>'
        });
    });

</script>
</body>
</html>